<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<head>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/style/gen-style.css"
	type="text/css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/style/mkv/jquery-ui.css"
	type="text/css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/style/makovo-style.css"
	type="text/css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/style/jquery.steps.css"
	type="text/css" />

<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/jquery-2.1.3.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/gen.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/auxiliares.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/jquery.steps.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/inegi.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/spin.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/scripts/jquery-ui-1.9.2.custom.min.js"></script>

<script type="text/javascript">
	//text ui-widget-content ui-corner-all
	var mVal = new Gen.Validator('val');
	$(function() {
		if (validaSesion("${sessionScope.LoginMenu}"))
			document.location = "index.jsp";
		var form = $("#ValidatorRegister").show();

		form.steps({
			headerTag : "h3",
			bodyTag : "fieldset",
			transitionEffect : "slideLeft",
			showFinishButtonAlways : false,
			enableFinishButton : false
		});

		$('[name=state]').change(function() {
			var stateId = $(this).val();
			$('[name=loc]').find('option').remove();
			$('[name=loc]').append($('<option value="-1">... Selecciones una opción ...</option>'))
			$('[name=lonng]').val("");
			$('[name=lat]').val("");

			$('[name=stateId]').val(stateId);
		});
		Inegi.fillStates($('[name=state]'));
	});
	function validate() {
		var errors = mVal.validate($('[name=ValidatorRegister]'), function() {
		});

		if (errors.length != 0) {
			$('#ValidatorRegister').steps('previous');
		}

		return errors.length == 0;
	}
</script>

</head>
<body>
	<div style="width: 1100px; margin: 0 auto">
		<div class="headerMK">
			<div class="logo">
				<span class="hdTitulo">Sistema para Aplicación de Subsidio
					2015</span>
			</div>
			<div
				style="font-size: 0.26em; top: -50px; position: relative; width: 500px; float: right; text-align: right; padding-right: 10px">
				<i>${sessionScope.LoginNombre}</i><b><a
					href="/makovo/paginas/index.jsp"> - Cerrar Sesión</a></b>
			</div>
		</div>
		<div class="divContenido">
			<a href="<%=request.getContextPath()%>/paginas/menu.jsp">Regresar
				al menú</a><br />
			<h3>Datos de Validador</h3>

			<div style="width: 1000px; margin: -5px auto;" id="tab">
				<s:form action="ValidatorRegister">
					<h3>Datos de Usuario</h3>
					<fieldset>
						<div style="width: 100%; float: left;">
							<div style="float: left; padding-left: 10px">
								Nombre (s):
								<s:textfield name="name" theme="simple" cssClass="inputText"
									val="text-spaces" />
							</div>
							<div style="float: left; padding-left: 10px">
								Apellido Paterno:
								<s:textfield name="lastName" theme="simple" cssClass="inputText"
									val="text-spaces" />
							</div>
							<div style="float: left; padding-left: 10px">
								Apellido Materno:
								<s:textfield name="secondLastName" theme="simple"
									cssClass="inputText" val="text-spaces" />
							</div>
						</div>

						<div style="width: 100%; float: left; padding-top: 10px">
							<div style="float: left; padding-left: 10px">
								Estado:<br />
								<s:select theme="simple" list="#{'1':'Mostrar estados'}"
									name="state" cssClass="inputSelect" val="selected"
									wrongOption="-1" />
								<s:hidden name="stateId" value="-1" />
							</div>
							<div style="float: left; padding-left: 10px">
								Número telefónico:
								<s:textfield name="phone" theme="simple" cssClass="inputText" />
							</div>
							<s:if test="hasActionErrors()">
								<div class="server-error" id="server-error">
									<span class="server-error-title">Verifique los
										siguientes campos:</span><br />
									<s:actionerror />
								</div>
								<script>
									$(function() {
										$('#server-error').dialog({
											autoOpen : true,
											resizable : true,

											width : 500,
											modal : true,
											buttons : {
												'Cerrar' : function() {
													$(this).dialog("close");
												}
											}
										});
									});
								</script>
							</s:if>
						</div>
					</fieldset>

					<h3>Finalizar</h3>
					<fieldset>
						<s:submit value="Generar registro" theme="simple"
							cssClass="class java.util.HashMap t-btn tinny change"
							onClick="if (!validate()) return false;" />
					</fieldset>
				</s:form>
			</div>
		</div>
	</div>
</body>
</html>